package cn.well.cloud.quartz.core.factory;
 
import cn.well.cloud.quartz.core.model.ScheduleJob;
import cn.well.cloud.quartz.core.task.TaskUtils;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;



/**
 * 
 * @Description: 计划任务执行处 无状态
 * @author wison
 * @date 2017年11月11日 下午5:05:47
 */
@Component
public class QuartzJobFactory implements Job { 
    private final Logger log = LoggerFactory.getLogger(this.getClass());
    @Autowired 
    private TaskUtils taskUtils;
    
	public void execute(JobExecutionContext context) throws JobExecutionException {
		ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get("scheduleJob");
		taskUtils.invokMethod(scheduleJob);
	}
}